package com.zzy.springbootdemo.design_05_singleton;

/**
 * 懒汉模式（线程安全）
 */
public class Singleton_03 {

    private static Singleton_03 singleton_03;

    private Singleton_03(){
    }

    public static synchronized Singleton_03 getInstance(){
        if(singleton_03 != null){
            return singleton_03;
        }
        return new Singleton_03();
    }

}
